//
//  ViewControllerChooser_iPhone.m
//  iFlick1.4
//
//  Created by vhly on 10-9-11.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import "ViewControllerChooser_iPhone.h"

static ViewControllerChooser_iPhone *chooser_iPhone;

@implementation ViewControllerChooser_iPhone

+ (ViewControllerChooser_iPhone *)getInstance{
	if (chooser_iPhone == nil) {
		chooser_iPhone = [[ViewControllerChooser_iPhone alloc] init];
	}
	return chooser_iPhone;
}

- (UIViewController *)choice:(NSInteger)vcid{
	UIViewController *ret = nil;
	switch (vcid) {
		case VC_BROWSER:
			if (browserVC == nil) {
				browserVC = [[BrowserViewController_iPhone alloc] initWithNibName:@"BrowserViewController_iPhone" bundle:nil];
			}
			ret = browserVC;
			break;
		case VC_SETTINGS:
			if (settingVC == nil) {
				settingVC = [[SettingViewController alloc] initWithNibName:@"SettingViewController" bundle:nil];
			}
			ret = settingVC;
			break;
		case VC_DETAIL:
			if (detailVC == nil) {
				detailVC = [[PhotoDetailViewController alloc] initWithNibName:@"PhotoDetailViewController" bundle:nil];
			}
			ret = detailVC;
			break;

		default:
			break;
	}
	return ret;
}

- (void)dealloc{
	[browserVC release];
	[settingVC release];
	[detailVC release];
	[super dealloc];
}

@end
